package com.im.users.controller;

import com.im.common.vo.MatchVo;
import com.im.security.annotation.LoginUser;
import com.im.security.dto.LoginVo;
import com.im.users.entity.UserEntity;
import com.im.users.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @auther Zeng
 * @date 2023/7/11 - 20:01
 * @Version 1.0
 */
//提供第三方服务接口
@Slf4j
@RestController
@RequestMapping("/third")
public class ThirdController {

    @Autowired
    private UserService userService;


    /**
     * 首页匹配
     * @param matchVo 匹配条件对象
     * @param loginVo 当前登录用户
     * @return
     */
    @PostMapping("/getMatch")
    public List<UserEntity> getMatchPeople(@RequestBody MatchVo matchVo,@LoginUser LoginVo loginVo) {
        log.info("getMatchPeople:loginVo:{}",loginVo);
        List records = userService.getMatch(matchVo,loginVo);
        return records;
    }
}
